﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using UI.WebPage.Background;
using Model.Cms;
using BLL.Cms;
using Com.Ompchina.Lib.Net;
namespace com.lifan.motorcycle.admin.cms
{
    public partial class list_news : ListInfoPage, IListInfo
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack && PageAction.Equals("list")) this.InitParameter();
        }

        #region IListInfo 成员

        public void InitParameter()
        {
            ddlTerm.DefaultSelect = RequestParam.GetString(Request, "termid");
            ddlYear.DefaultSelect = RequestParam.GetString(Request, "year");
            ddlOnline.DefaultSelect = RequestParam.GetString(Request, "isonline");
        }

        public void ExecuteUpdate()
        {
            throw new NotImplementedException();
        }

        #endregion

        #region 页面私有方法
        protected IList<NewsInfo> _GetNews(int pageSize, out int recordCount) 
        {
            return new NewsBLL().BackList(int.Parse(ddlTerm.SelectedValue), ddlYear.SelectedValue, ddlOnline.SelectedValue
                , PageIndex, pageSize, out recordCount);
        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Redirect(string.Format("list_news.aspx?action=list&termid={0}&year={1}&isonline={2}"
                , ddlTerm.SelectedValue, ddlYear.SelectedValue, ddlOnline.SelectedValue), 0);
        }
        #endregion

        
    }
}